@dialog-name: m-dialog;

.@{dialog-name} {
  &__wrapper {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: auto;
    margin: 0;
    z-index: 20000;
  }
  &__auto {
    text-align: center;
    .@{dialog-name} {
      display: inline-block;
      text-align: left;
      width: auto;
    }
  }
  &__top {
    z-index: 25000;
  }
  &__bottom {
    z-index: 5000;
  }
  &__middle {
    display: flex;
    align-items: center;
    justify-content: center;

    & .@{dialog-name}{
      margin: 0 !important;
    }
  }
  width: 30%;
  margin: 0px auto 50px;
  margin-top: 15vh;
  position: relative;
  // box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 3px;
  box-shadow: 0 2px 20px rgba(26, 26, 26, 0.1);
  box-sizing: border-box;
  border-radius: 3px;
  background: #fff;

  & &__header,
  & &__body,
  & &__footer {
    padding: 15px;
    box-sizing: border-box;
    word-break: break-word;
  }
  & &__header {
    padding-bottom: 10px;
  }

  & &__title {
    font-size: 16px;
    color: #2c3e50;
    margin-right: 25px;
  }
  & &__close {
    font-weight: 100;
    font-size: 20px;
    color: #909399;
    position: absolute;
    top: 11px;
    right: 15px;
    padding: 0;
    background: 0 0;
    border: none;
    outline: 0;
    cursor: pointer;
  }
  & &__close:hover {
    color: #ef4848;
  }

  & &__footer:before,
  & &__footer:after {
    content: "";
    display: table;
    clear: both;
  }
}

.slide-fade-enter-active {
  animation: slide-down-in .3s;
}
.slide-fade-leave-active {
  animation: slide-up-out .3s;
}

.scale-fade-enter-active {
  animation: scale-in .3s;
}
.scale-fade-leave-active {
  animation: slide-up-out .3s;
}

@keyframes slide-down-in {
  0% {
    transform: translate3d(0,-20px,0);
    opacity: 0;
  }
  100% {
    transform: translate3d(0,0,0);
    opacity: 1;
  }
}

@keyframes slide-up-out {
  0% {
    transform: translate3d(0,0,0);
    opacity: 1;
  }
  100% {
    transform: translate3d(0,-20px,0);
    opacity: 0;
  }
}

@keyframes scale-in {
  0% {
    transform: scale(0.9);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}


.m-popup-wrapper {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: auto;
  margin: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
}

.popup-fade-enter-active {
  animation: popup-fade-in 0.3s;
}
.popup-fade-leave-active {
  animation: popup-fade-out 0.3s;
}

@keyframes popup-fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes popup-fade-out {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}


/* message-box */
.m-message-box {
  .m-dialog__footer {
    text-align: right;
  }

  .m-message-box--content.has-type-icon {
    padding-left: 50px;
  }

  .m-message-box-type-img {
    width: 30px;
    height: 30px;
    margin-left: -45px;
    margin-top: -5px;
    float: left;
    vertical-align: middle;
  }

  .m-dialog__body p {
    margin: 0;
  }

  .m-message-button--cancel,
  .m-message-button--confirm {
    background: none;
    border: none;
    border-radius: 3px;
    outline: none;
    font-weight: bold;
    font-size: 13px;
    padding: 10px 20px;
    color: #5e6175;
    cursor: pointer;
    vertical-align: middle;
  }

  .m-message-button--confirm {
    margin-left: 5px;
    color: #1297e4;

    &:hover {
      color: #1297e4;
      background-color: #f1f0f0;
    }
  }
  .m-message-button--cancel {
    &:hover {
      color: #D8364B;
      background-color: #f9ecec;
    }
  }
}
